#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int eliminateMaximum(vector<int> &dist, vector<int> &speed)
    {
        vector<int> t;
        for (int i = 0; i < dist.size(); ++i)
        {
            if (dist[i] % speed[i] == 0)
            {
                t.push_back(dist[i] / speed[i]);
            }
            else
            {
                t.push_back(dist[i] / speed[i] + 1);
            }
        }
        sort(t.begin(), t.end());
        int count = 0;
        for (int i = 0; i < t.size(); ++i)
        {
            if (t[i] <= count)
            {
                break;
            }
            ++count;
        }
        return count;
    }
};